<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2025年1024程序员节快乐</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Courier New', monospace;
            background-color: #0a192f;
            color: #64ffda;
            overflow: hidden;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            width: 100%;
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
            z-index: 10;
            padding: 20px 0;
        }

        .header {
            margin-bottom: 10px;
        }

        .title {
            font-size: clamp(1.8rem, 5vw, 3.5rem);
            margin-bottom: 10px;
            text-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
            animation: glow 2s ease-in-out infinite alternate;
        }

        .subtitle {
            font-size: clamp(0.9rem, 3vw, 1.5rem);
            color: #8892b0;
            margin-bottom: 20px;
        }

        .code-rain {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1;
        }

        .code-char {
            position: absolute;
            color: #64ffda;
            font-size: 16px;
            opacity: 0.7;
            text-shadow: 0 0 5px rgba(100, 255, 218, 0.5);
            user-select: none;
        }

        .content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 20px;
            flex-grow: 1;
        }

        .stats {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 15px;
            margin: 10px 0;
        }

        .stat-box {
            background: rgba(17, 34, 64, 0.7);
            border: 1px solid #64ffda;
            border-radius: 8px;
            padding: 15px;
            min-width: 120px;
            box-shadow: 0 0 15px rgba(100, 255, 218, 0.2);
        }

        .stat-value {
            font-size: 2rem;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .stat-label {
            color: #8892b0;
            font-size: 0.8rem;
        }

        .interactive-area {
            background: rgba(17, 34, 64, 0.7);
            border: 1px solid #64ffda;
            border-radius: 8px;
            padding: 20px;
            width: 100%;
            max-width: 500px;
            margin: 10px auto;
            box-shadow: 0 0 15px rgba(100, 255, 218, 0.2);
        }

        .code-input {
            width: 100%;
            background: transparent;
            border: 1px solid #64ffda;
            border-radius: 4px;
            color: #64ffda;
            padding: 10px;
            font-family: 'Courier New', monospace;
            margin: 10px 0;
            resize: none;
            min-height: 80px;
            font-size: 0.9rem;
        }

        .btn {
            background: transparent;
            border: 1px solid #64ffda;
            color: #64ffda;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            margin: 5px;
        }

        .btn:hover {
            background: rgba(100, 255, 218, 0.1);
            box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
        }

        .result {
            margin-top: 15px;
            padding: 10px;
            border-radius: 4px;
            background: rgba(17, 34, 64, 0.9);
            min-height: 50px;
            text-align: left;
            font-size: 0.85rem;
            color: #e6f1ff;
        }

        .footer {
            color: #8892b0;
            font-size: 0.8rem;
            padding: 10px;
        }

        .binary-clock {
            margin: 15px 0;
            display: flex;
            justify-content: center;
            gap: 8px;
        }

        .binary-digit {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .bit {
            width: 15px;
            height: 15px;
            border-radius: 50%;
            background: #112240;
            border: 1px solid #64ffda;
            transition: all 0.3s ease;
        }

        .bit.on {
            background: #64ffda;
            box-shadow: 0 0 10px #64ffda;
        }

        .programmer-icon {
            font-size: 2.5rem;
            margin: 10px 0;
            animation: float 3s ease-in-out infinite;
        }

        @keyframes glow {
            from {
                text-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
            }
            to {
                text-shadow: 0 0 20px rgba(100, 255, 218, 0.8), 0 0 30px rgba(100, 255, 218, 0.6);
            }
        }

        @keyframes float {
            0% {
                transform: translateY(0px);
            }
            50% {
                transform: translateY(-10px);
            }
            100% {
                transform: translateY(0px);
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 10px 0;
            }
            
            .stats {
                gap: 10px;
            }
            
            .stat-box {
                min-width: 100px;
                padding: 10px;
            }
            
            .stat-value {
                font-size: 1.5rem;
            }
            
            .interactive-area {
                padding: 15px;
            }
            
            .binary-clock {
                gap: 5px;
            }
            
            .bit {
                width: 12px;
                height: 12px;
            }
            
            .programmer-icon {
                font-size: 2rem;
            }
        }

        @media (max-height: 700px) {
            .container {
                justify-content: flex-start;
                gap: 10px;
            }
            
            .header {
                margin-bottom: 5px;
            }
            
            .content {
                gap: 10px;
            }
            
            .stats {
                margin: 5px 0;
            }
            
            .interactive-area {
                margin: 5px auto;
            }
            
            .footer {
                padding: 5px;
            }
        }
    </style>
</head>
<body>
    <div class="code-rain" id="codeRain"></div>
    
    <div class="container">
        <div class="header">
            <h1 class="title">🎉 1024程序员节快乐 🎉</h1>
            <p class="subtitle">致敬每一位用代码改变世界的工程师</p>
            <div class="programmer-icon">
                <i class="fas fa-laptop-code"></i>
            </div>
        </div>
        
        <div class="content">
            <div class="stats">
                <div class="stat-box">
                    <div class="stat-value" id="coffeeCount">0</div>
                    <div class="stat-label">今日咖啡杯数</div>
                </div>
                <div class="stat-box">
                    <div class="stat-value" id="bugCount">0</div>
                    <div class="stat-label">已修复Bug数</div>
                </div>
                <div class="stat-box">
                    <div class="stat-value" id="codeLines">0</div>
                    <div class="stat-label">今日代码行数</div>
                </div>
            </div>
            
            <div class="binary-clock" id="binaryClock">
                <!-- 二进制时钟将由JS动态生成 -->
            </div>
            
            <div class="interactive-area">
                <h3>程序员节专属编译器</h3>
                <p>输入你的祝福代码，看看会编译出什么惊喜！</p>
                <textarea class="code-input" id="codeInput" placeholder="// 在这里输入你的代码祝福..."></textarea>
                <div>
                    <button class="btn" id="compileBtn">编译运行</button>
                    <button class="btn" id="debugBtn">调试</button>
                </div>
                <div class="result" id="result">
                    // 编译结果将显示在这里
                </div>
            </div>
        </div>
        
        <div class="footer">
            <p>© 2025 1024程序员节 | 代码改变世界，逻辑创造未来</p>
        </div>
    </div>

    <script>
        // 代码雨效果
        function createCodeRain() {
            const codeRain = document.getElementById('codeRain');
            const chars = '01{}[]<>();:#@%&*+-=/';
            
            for (let i = 0; i < 80; i++) {
                const char = document.createElement('div');
                char.className = 'code-char';
                char.textContent = chars[Math.floor(Math.random() * chars.length)];
                char.style.left = Math.random() * 100 + 'vw';
                char.style.top = Math.random() * 100 + 'vh';
                char.style.animationDuration = (Math.random() * 10 + 5) + 's';
                char.style.animationDelay = Math.random() * 5 + 's';
                codeRain.appendChild(char);
            }
            
            // 为每个字符添加动画
            document.querySelectorAll('.code-char').forEach(char => {
                char.style.animation = `fall ${char.style.animationDuration} linear ${char.style.animationDelay} infinite`;
            });
            
            // 添加CSS动画
            const style = document.createElement('style');
            style.textContent = `
                @keyframes fall {
                    to {
                        transform: translateY(100vh);
                        opacity: 0;
                    }
                }
            `;
            document.head.appendChild(style);
        }
        
        // 动态统计数字
        function animateStats() {
            const coffeeCount = document.getElementById('coffeeCount');
            const bugCount = document.getElementById('bugCount');
            const codeLines = document.getElementById('codeLines');
            
            animateValue(coffeeCount, 0, 8, 2000);
            animateValue(bugCount, 0, 42, 2500);
            animateValue(codeLines, 0, 1024, 3000);
        }
        
        function animateValue(element, start, end, duration) {
            let startTimestamp = null;
            const step = (timestamp) => {
                if (!startTimestamp) startTimestamp = timestamp;
                const progress = Math.min((timestamp - startTimestamp) / duration, 1);
                element.innerHTML = Math.floor(progress * (end - start) + start);
                if (progress < 1) {
                    window.requestAnimationFrame(step);
                }
            };
            window.requestAnimationFrame(step);
        }
        
        // 二进制时钟
        function createBinaryClock() {
            const binaryClock = document.getElementById('binaryClock');
            
            function updateBinaryClock() {
                const now = new Date();
                const hours = now.getHours().toString().padStart(2, '0');
                const minutes = now.getMinutes().toString().padStart(2, '0');
                const seconds = now.getSeconds().toString().padStart(2, '0');
                
                const timeString = hours + minutes + seconds;
                binaryClock.innerHTML = '';
                
                for (let i = 0; i < timeString.length; i++) {
                    const digit = document.createElement('div');
                    digit.className = 'binary-digit';
                    
                    const num = parseInt(timeString[i]);
                    const binary = num.toString(2).padStart(4, '0');
                    
                    for (let j = 0; j < binary.length; j++) {
                        const bit = document.createElement('div');
                        bit.className = 'bit';
                        if (binary[j] === '1') {
                            bit.classList.add('on');
                        }
                        digit.appendChild(bit);
                    }
                    
                    binaryClock.appendChild(digit);
                }
            }
            
            updateBinaryClock();
            setInterval(updateBinaryClock, 1000);
        }
        
        // 交互功能
        function setupInteractions() {
            const codeInput = document.getElementById('codeInput');
            const compileBtn = document.getElementById('compileBtn');
            const debugBtn = document.getElementById('debugBtn');
            const result = document.getElementById('result');
            
            const responses = [
                "编译成功！🎉 你的代码将创造美好未来！",
                "警告：检测到无限潜力！🚀",
                "错误：缺少咖啡因，建议立即补充！☕",
                "运行结果：世界因你的代码而更美好！✨",
                "调试信息：程序员是世界上最酷的职业！💻",
                "输出：Happy 1024! 愿你代码无Bug！🐞",
                "状态：代码优雅，逻辑清晰，堪称完美！🌟",
                "提示：记得今天给自己放个假！🎯"
            ];
            
            compileBtn.addEventListener('click', () => {
                if (codeInput.value.trim() === '') {
                    result.textContent = "错误：请输入代码！";
                    return;
                }
                
                const randomResponse = responses[Math.floor(Math.random() * responses.length)];
                result.textContent = randomResponse;
                
                // 添加一些视觉效果
                result.style.animation = 'none';
                setTimeout(() => {
                    result.style.animation = 'glow 1s ease-in-out';
                }, 10);
            });
            
            debugBtn.addEventListener('click', () => {
                const debugMessages = [
                    "调试中... 发现一个隐藏的彩蛋！🥚",
                    "调试完成！所有问题已解决！✅",
                    "调试信息：你的代码质量评分：1024/1024！",
                    "调试日志：今天是个值得庆祝的日子！🎊"
                ];
                
                const randomMessage = debugMessages[Math.floor(Math.random() * debugMessages.length)];
                result.textContent = randomMessage;
            });
            
            // 添加一些示例代码
            codeInput.value = `// 程序员节快乐！
function celebrate() {
  console.log("Happy 1024!");
  return "愿你的代码永远无Bug";
}`;
        }
        
        // 初始化所有功能
        document.addEventListener('DOMContentLoaded', () => {
            createCodeRain();
            animateStats();
            createBinaryClock();
            setupInteractions();
        });
    </script>
</body>
</html>